package com.sas.domain;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;

import org.springframework.util.Assert;

@SuppressWarnings("serial")
@Entity
public class Stock extends PersistentEntity {
	@ManyToOne
	private Article article;
	private Integer countBox;
	private Integer countUnitPerBox;
	private Integer count;
	private Double buyPrice;
	private String place;
	private String observation;
	
	Stock () {
	}
	
	public Integer getCount() {
		return count;
	}
	public void setCount(Integer count) {
		Assert.notNull(count);
		this.count = count;
	}
	public String getPlace() {
		return place;
	}
	public void setPlace(String place) {
		Assert.hasText(place);
		this.place = place;
	}
	public String getObservation() {
		return observation;
	}
	public void setObservation(String observation) {
		Assert.notNull(observation);
		this.observation = observation;
	}

	public void setBuyPrice(Double price) {
		Assert.notNull(price);
		Assert.state(price >= 0);
		this.buyPrice = price;
	}

	public Double getBuyPrice() {
		return buyPrice;
	}

	public void setCountBox(Integer countBox) {
		Assert.notNull(countBox);
		Assert.state(countBox >= 0);
		this.countBox = countBox;
	}

	public Integer getCountBox() {
		return countBox;
	}

	public void setCountUnitPerBox(Integer countUnitPerBox) {
		Assert.notNull(countUnitPerBox);
		Assert.state(countUnitPerBox >= 0);
		this.countUnitPerBox = countUnitPerBox;
	}

	public Integer getCountUnitPerBox() {
		return countUnitPerBox;
	}

	public void setArticle(Article article) {
		Assert.notNull(article);
		this.article = article;
	}

	public Article getArticle() {
		return article;
	}
	
	
}
